<?php
/**
* @package YARBB
* @copyright Авторские права (C) 2009 www.yar-it.com. Все права защищены.
* @license Лицензия http://www.gnu.org/licenses/gpl-2.0.htm GNU/GPL, или help/license.php
* YARBB! - свободное программное обеспечение распространяемое по условиям лицензии GNU/GPL
* Для получения информации о используемых расширениях и замечаний об авторском праве, смотрите файл copyright.php.
*/
	defined( '_JEXEC' ) or die( 'Restricted Access' );
	global $ybbConfig;
	$dispclr = $this->theme;
	$userArray = array();
?>

<form action="<?php echo $this->action; ?>" method="post" name="FrmPostlist" id="FrmPostlist">
  <div class="ybbmaindiv">
    <table class="ybbnormaltable" cellpadding="0" cellspacing="0">
      <tr>
        <td class="ybbtopleft"></td>
        <td class="ybbtopmiddle">&nbsp;<?php echo $ybbConfig->boardname;?> </td>
        <td class="ybbtopright"></td>
      </tr>
      <tr>
        <td class="ybbleftbody"></td>
        <td class="ybbheaderrow"><table class="ybbnormaltable" cellpadding="5" cellspacing="5">
            <tr>
              <td><div id="yarbb_menu">
                <ul id="ybbmenu">
                  <?php echo $this->userprofile['home']; ?>
                  <li class="node"><a>Инструменты</a>
                    <ul>
                      <?php echo $this->userprofile['latest']; ?> 
					  <?php echo $this->userprofile['link']; ?> 
					  <?php echo $this->userprofile['mylist']; ?> 
					  <?php echo $this->userprofile['approval']; ?>
                    </ul>
                  </li>
                </ul>
              </div></td>
              <td class="ybbheaderusername"><?php echo JText::_('WELCOME') . ' ' .  $this->userprofile['boardusername']; ?></td>
              <td class="ybbheaderavatar"><?php echo $this->userprofile['thumb']; ?></td>
            </tr>
          </table></td>
        <td class="ybbrightbody"></td>
      </tr>
      <?php foreach($this->sticky as $rec ) { ?>
      <tr>
        <td class="ybbleftbody"></td>
        <td class="ybbheaderrow"><table class="ybbnormaltable" cellpadding="0" cellspacing="0">
            <tr>
              <td class="ybbtopicicon"><img src="<?php echo YARBB_ASSETS_URL_THEME.'/'.$dispclr; ?>/img/sticky<?php echo $rec->topic_type; ?>.gif" class="ybbiconimg" /></td>
              <td class="ybblinetop"><a href="<?php echo JRoute::_('index.php?option=com_yarbb&view=postlist&forum=' . (int)$rec->forum_id . '&topic=' . (int)$rec->id . '&Itemid=' . $ybbConfig->itemid); ?>"> <b><?php echo $this->escape($rec->post_subject); ?></b> </a>&nbsp; </td>
              <td class="ybbfrmlast"><?php
								if( $rec->post_time != 0 ) {
									if( $rec->post_user > 0 ) {
										if( isset( $userArray[$rec->post_user])) {
											$uname = $userArray[$rec->post_user];
										} else {
											$uname = yarbbHelperConfig::getUserName( $rec->post_user );
											$userArray[$rec->post_user] = $uname;
										}
                                        $uname = '<a href="'. JRoute::_('index.php?option=com_yarbb&view=myprofile&cid=' . $rec->post_user . '&Itemid=' . $ybbConfig->itemid ) . '">' . $uname . '</a>';
									} else {
										$uname = $rec->post_username;
									}
								}
								echo JText::_('POST_LIST_BY') . '&nbsp;<b>'. $uname . '</b>&nbsp;' . JText::_('POST_LIST_ON') . '&nbsp;' .
										JHTML::_('date', $rec->post_time + $ybbConfig->timeoffset, $ybbConfig->dateformat);
							?>
              </td>
            </tr>
          </table></td>
        <td class="ybbrightbody"></td>
      </tr>
      <?php } ?>
      <tr class="ybbtablefooter">
        <td class="ybbbotleft"></td>
        <td class="ybbbotmiddle"></td>
        <td class="ybbbotright"></td>
      </tr>
      <tr>
        <td colspan="3" class="ybbtpkmenucol"><a rel="nofollow" class="ovalbutton" href="<?php echo JRoute::_('index.php?option=com_yarbb&view=mylist&viewmode=myposts&Itemid='.$ybbConfig->itemid); ?>"> <span><?php echo  $this->labels['myposts']; ?></span> </a> <a rel="nofollow" class="ovalbutton" href="<?php echo JRoute::_('index.php?option=com_yarbb&view=mylist&viewmode=mysubs&Itemid='.$ybbConfig->itemid); ?>"> <span><?php echo  $this->labels['mysubs']; ?></span> </a> <a rel="nofollow" class="ovalbutton" href="<?php echo JRoute::_('index.php?option=com_yarbb&view=mylist&viewmode=myfavours&Itemid='.$ybbConfig->itemid); ?>"> <span><?php echo  $this->labels['myfavours']; ?></span> </a> </td>
      </tr>
      <tr>
        <td class="ybbtopleft"></td>
        <td class="ybbtopmiddle">&nbsp;<?php echo $this->labels['pagetitle'];?> </td>
        <td class="ybbtopright"></td>
      </tr>
      <tr>
        <td class="ybbleftbody"></td>
        <td class="ybbtpkdetail"><table class="ybbnormaltable" cellpadding="4" cellspacing="0">
            <tr>
              <td class="ybbfrmrowcol1"></td>
              <td class="ybbfrmrowcol6"></td>
              <td class="ybbfrmrowcol2"><b><?php echo $this->labels['subject']; ?></b></td>
              <td class="ybbfrmrowcol2"><b><?php echo $this->labels['forum']; ?></b></td>
              <td class="ybbfrmrowcol4"><b><?php echo $this->labels['date']; ?></b></td>
              <td class="ybbtpkcol3"><b><?php echo $this->labels['hits']; ?></b></td>
              <?php if( $this->viewmode <> 'myposts') { ?>
              <td class="ybbtpkcol3">&nbsp;</td>
              <?php } ?>
            </tr>
            <tr>
              <?php foreach ($this->items as $item) { ?>
            <tr>
              <td class="ybbfrmrowcol1"><img src="<?php echo YARBB_ASSETS_URL_THEME.'/'.$dispclr; ?>/img/topic<?php if($item->locked == 1) echo '-locked'; ?>.gif" /></td>
              <td class="ybblinetop" style="text-align: center;"><?php
									if( $item->topic_emoticon > 0) {
										echo '<img src="' .  YARBB_ASSETS_URL_THEME . '/'.$dispclr. '/topic_icon/' . $item->topic_emoticon . '.gif" />';
									}
			 					?>
              </td>
              <td class="ybblinetop" align="left"><a href="<?php echo JRoute::_('index.php?option=com_yarbb&view=postlist&forum='. $item->forum_id .'&topic='. $item->topic_id .'&Itemid='.$ybbConfig->itemid); ?>"> <?php echo $this->escape($item->post_subject); ?> </a> </td>
              <td class="ybblinetop" align="left"><?php echo $item->forum_name; ?></td>
              <td class="ybblinetop" align="center"><?php echo JHTML::_('date', $item->post_time+ $ybbConfig->timeoffset, $ybbConfig->dateformat); ?></td>
              <td class="ybblinetop" align="center"><?php echo (int)$item->hits; ?></td>
              <?php if( $this->viewmode <> 'myposts') { ?>
              <td><a rel="nofollow" class="squarebutton" href="<?php echo 'index.php?option=com_yarbb&view=mylist&viewmode=' . $this->viewmode . '&task=delMyPosts&forum='. $item->forum_id .'&topic='. $item->topic_id . '&Itemid='.$ybbConfig->itemid; ?>"> <span><?php echo  $this->labels['delete']; ?></span> </a> </td>
              <?php } ?>
            </tr>
            <?php } ?>
          </table></td>
        <td class="ybbrightbody"></td>
      </tr>
      <tr class="ybbtablefooter">
        <td class="ybbbotleft"></td>
        <td class="ybbbotmiddle"></td>
        <td class="ybbbotright"></td>
      </tr>
      <tr>
        <td colspan="3" class="ybbtpkmenu"><table class="ybbnormaltable" cellpadding="0" cellspacing="0">
            <tr>
              <td class="ybbfrmrowcol5"><?php if(count($this->items) > 0 ) { echo JText::_('PAGE') . ' #&nbsp;'; echo $this->pagination->getLimitBox(); } ?>
              </td>
              <td class="ybbtpkpages"><?php if(count($this->items) > 0 ) echo $this->pagination->getPagesLinks(); ?>
              </td>
            </tr>
          </table></td>
      </tr>
    </table>
    <input type="hidden" name="option" value="com_yarbb" />
    <input type="hidden" name="viewmode" value="<?php echo $this->viewmode; ?>" />
    <input type="hidden" name="task" value="" />
  </div>
  <br/>
</form>
<?php echo YARBB_COPYRIGHT; ?> <br/>
